<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@include file="chksiteuser.jsp"%>
<%@ include file="../connstring.jsp"%>
<%
request.setCharacterEncoding("utf-8");
String strId =request.getParameter("id");
String strUs =request.getParameter("us");
String strPh =request.getParameter("ph");
String strAr =request.getParameter("ar");
String strTy =request.getParameter("ty");

if(strId==null) strId="0";
if(strUs==null) strUs="";
if(strPh==null) strPh="";
if(strAr==null) strAr="";
if(strTy==null) strTy="";


if(strUs.equals("")||strPh.equals("")||strAr.equals("")||strTy.equals("")){
%>
<script type="text/javascript">
alert('所以数据必须填写!\n请重试……');
history.go(-1);
</script>
<%
}
else{
 Connection conn = null;
 Statement stmt = null;
 
 try{
	 Class.forName(driver);
	 conn =DriverManager.getConnection(url);
	 stmt = conn.createStatement();
	 String sql = "update areamanage set name='"+strUs
			 +"',phone='"+strPh
			 +"',area='"+strAr
			 +"',types='"+strTy
			 +"' where id ="+strId;
	 stmt.executeUpdate(sql);
	 response.sendRedirect("arealist.jsp");
 }catch(Exception ex){
	 
   out.println(ex.getMessage());
   
 }finally{
	 if(stmt!=null) stmt.close();
	 if(conn!=null) conn.close();
 }
}
%>